package com.jd.sunny.java.multithreading;

/**
 * @Description:
 * @author:sunlin
 * @since:2012-12-10 11:45
 * @version:1.0.0
 */

/**
 * 2.extends Thread and override run method
 */
public class MyThread extends Thread{

    @Override
    public void run() {
        while (true){
            System.out.println("Thread is running");
            try {
                //sleep 1 second
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[]args){
        MyThread myThread = new MyThread();
        myThread.start();
    }

}
